#!/bin/bash
##安装docker服务
sh configure/serroundings/disSafety.sh ##关闭selinux及防火墙
########--------------------------------------docker检测--------------------------------------##
rpmd=$(rpm -qa | grep docker)
if [ -z "$rpmd" ];then
	echo -e "\033[1m-----------------------正在安装docker服务=============================================—————\033[0m]"
	echo -e "\033[5;35m --------------请耐心等待，在此之间为避免意外请不要按键盘-----------------\033[0m"
	echo -e "\033[5;35m --------------你现在可以去买一份泡面，接上热水等待，然后你会发现你没带钱-----------------\033[0m"
	echo -e "net.ipv4.ip_forward = 1\nnet.ipv4.conf.default.rp_filter = 0 \nnet.ipv4.conf.all.rp_filter = 0" > /etc/sysctl.conf
	sysctl -p
	sed -i 's/SELINUX=.*/SELINUX=disabled/g' /etc/sysconfig/selinux
	yum install  docker -y -q
	echo -e "\033[1m-----------------------docker服务已安装=============================================—————\033[0m]"
	echo -e "\033[1m-----------------------重启docker服务中-=============================================—————\033[0m]"
	systemctl daemon-reload
	service=docker
	sh configure/Detection/service-start.sh
	sh configure/Detection/service-enable.sh
	echo  ——————-------------------docker服务已启动并设置开机自启-------------------------
	echo   ————————————————————————————建议更换到更快的docker镜像仓库——————————————————————————————————————
else
	echo -e "\033[31m --------------系统检测到你本机已安装docker服务-----------------\033[0m"
fi
